<?php
if(isset($_POST['staff_id'])) {
	PutEnv("ORACLE_HOME=/usr/local/dbpackages/oracle");

	$c = oci_connect('comp231stu032', 'chemistry', 'comp231.cse.ust.hk');

	if(!$c) {
		echo "<p>Unable to connect:" . var_dump(oci_error($c));
		die();
	}

	$s = "insert into staff values (" .$_POST['staff_id']. ",'" .$_POST['surname']. "','" .$_POST['give_name']. "','" .$_POST['working_status']. "','" .$_POST['time_slot']. "','" .$_POST['skill']. "'," .$_POST['reward']. ")";

	
	$q = oci_parse($c, $s);

	oci_execute($q);
}
